$OpenBSD: patch-Makefile_PL,v 1.5 2015/08/13 08:47:52 benoit Exp $
--- Makefile.PL.orig	Wed Aug 12 14:56:32 2015
+++ Makefile.PL	Thu Aug 13 09:19:35 2015
@@ -52,7 +52,8 @@
 
 %WriteMakefileArgs = (
     %WriteMakefileArgs,
-    'LIBS' => ['-lgmp'],,
+    'INC'  => "$ENV{CPPFLAGS}",
+    'LIBS' => ["$ENV{LDFLAGS} -lgmp"],,
 );
 
 my %FallbackPrereqs = (
